<template>
  <div>
    <div id="my-main">
      <div class="my-main">
        <span>欧美男歌手</span>
        <a href="#">更多></a>
      </div>
      <div class="main">
        <a href="#">热门</a>
        <span
          v-for="(k, i) in 26"
          :key="i"
          @click="current = i"
          :class="{ active: current == i }"
          >{{ String.fromCharCode(65 + k - 1) }}</span
        >
        <span>其他</span>
      </div>
    </div>
    <div id="my-main1">
      <ul v-if="singer">
        <li
          v-for="{ id, name, img1v1Url } in singer.slice(0, 10)"
          :key="id"
          class="singerCube"
        >
          <a href=""><img :src="img1v1Url" alt="" /></a>
          <span>{{ name }}</span>
        </li>
      </ul>
    </div>
    <div id="zm">
      <ul v-if="singer">
        <li v-for="{ id, name } in singer" :key="id">
          <a href="#">{{ name }}</a>
        </li>
      </ul>
    </div>


  </div>
</template>

<script>
export default {
   
  props: ["type", "area", "initial"],
    data() {
    return {
      singer: null,
      current: -1,
    };
  },
  mounted() {
    this.getSinger();
    console.log(this);
  },
  methods: {
    getSinger() {
      //  const url = `/artist/list?limit=100&type=${type}&area=${area}`;
      const url = "/artist/list?limit=100&type=1&area=96";
      console.log(url);
      this.axios.get(url).then((res) => {
        console.log(res);
        this.singer = res.data.artists;
        console.log(this.singer);
      });
    },
  },
};

</script>

<style lang="scss" scoped>

#zm{
    width: 720px;
    margin: 0 auto;
    height: 1000px;
   ul li{
       width: 140px;
       height: 30px;
       display: flex;
       flex-direction: column;
       float: left;
       a{
           color: #000;
           cursor: pointer;
       }
   }
}
#my-main1 {
  width: 720px;
  margin: 0 auto;
}
#my-main1 ul li {
  width: 120px;
  height: 190px;
  display: flex;
  flex-direction: column;
  float: left;
  margin-right: 20px;
  span {
    font-size: 12px;
    color: #000;
    margin-top: 15px;
    cursor: pointer;
  }
}
img {
  width: 130px;
  height: 130px;
}
.main span:last-child {
  width: 24px;
  height: 24px;
  color: #333333;
  display: inline-block;
  font-size: 12px;
  padding-left: 10px;
}
.main span {
  width: 21px;
  height: 24px;
  color: #333333;
  display: inline-block;
  font-size: 12px;
  padding: 0 1px;
  &:hover {
    text-decoration: underline;
    cursor: pointer;
  }
  &.active {
    color: white;
    width: 24px;
    height: 24px;
    background-color: #c20c0c;
    display: inline-block;
    line-height: 24px;
    text-align: center;
    border-radius: 4px;
    font-size: 12px;
    user-select: none;
  }
}
.main a {
  color: #ffffff;
  width: 45px;
  height: 24px;
  background-color: #c20c0c;
  display: inline-block;
  line-height: 24px;
  text-align: center;
  border-radius: 4px;
  margin: 20px 0;
  font-size: 12px;
  margin-right: 10px;
  user-select: none;
  cursor: pointer;
}
.my-main {
  width: 100%;
  height: 42px;
  color: #333333;
  border-bottom: 2px solid red;
  display: flex;
  justify-content: space-between;
  span {
    font-size: 24px;
  }
  a {
    text-decoration: none;
    color: #666666;
    font-size: 12px;
    margin: 14px 0 0;
  }
}
#my-main {
  width: 720px;
  margin: 0 auto;
  margin-top: 50px;
}
* {
  padding: 0;
  margin: 0;
}
#header {
  width: 100%;
  height: 35px;
  background-color: #c20c0c;
}
#my-header {
  width: 1100px;
  margin: 0 auto;
}
#my-header a {
  width: 84px;
  height: 35px;
  display: inline-block;
  cursor: pointer;
  text-align: center;
  line-height: 20px;
  position: relative;
  cursor: pointer;
  > em {
    display: inline-block;
    width: 50px;
    height: 20px;
    color: white;
    margin-top: 20px;
    margin: 7px 17px 0px;
    font-size: 12px;
  }
}
#sjx {
  width: 0;
  height: 0;
  border-bottom: 12px solid red;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  position: absolute;
  margin-top: -12px;
  margin-left: 32px;
}
#mybody {
  width: 990px;
  height: 1493px;
  margin: 0 auto;
  border: 1px solid #ddd;
}
#my-aside {
  width: 160px;
  height: 135px;
  margin: 5px 0 0;
  padding: 16px 0 0;
  border-bottom: 1px solid red;
  margin: 0 10px;
}
h2 {
  color: #333333;
  font-size: 16px;
  font-weight: 800;
  height: 25px;
  padding: 0 0 0 14px;
  display: inline-block;
}
ul li em {
  height: 29px;
  font-size: 12px;
  padding: 0 0 0 27px;
  display: inline-block;
  line-height: 29px;
  a{
      color: #000;
      cursor: pointer;
  }
}
</style>